package com.wangkang.eduservice.controller;
import com.wangkang.commonutils.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;


@Api(tags = "用户登录")
@RestController
@RequestMapping("/eduservice/user")
//@CrossOrigin//解决跨域
public class EduLoginController {


    /**
     * 登录
     * @return R
     */
    @PostMapping("/login")
    public R login(){
        return R.ok().data("token","admin");
    }

    /**
     * 获取用户信息
     * @return R
     */
    @GetMapping("/info")
    public R info(){
        return R.ok().data("roles","[admin]").data("name","admin")
                .data("avatar","https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1023235865,1560869099&fm=26&gp=0.jpg");

    }
}